<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
<title>Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop the viewport. -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<link rel="stylesheet" type="text/css" href="style.css" />
<link href="http://fonts.googleapis.com/css?family=Merriweather:400,400italic,700,700italic|Source+Code+Pro|Source+Sans+Pro:200,300,400,600,400italic,600italic|Rock+Salt" rel="stylesheet" type="text/css">
</head>
<body class="index">
<div class="page">
<div class="content">
<aside class="index">

<div class="sign-up">
  <h2>Want to read it on paper/eBook?</h2>
  <p>I&#8217;m working on those now! Join the mailing list and I&#8217;ll tell you when they&#8217;re ready:</p>

  <!-- Begin MailChimp Signup Form -->
  <div id="mc_embed_signup">
  <form action="http://gameprogrammingpatterns.us7.list-manage.com/subscribe/post?u=0952ca43ed2536d6717766b88&amp;id=0c27329244" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
    <input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
    <input type="submit" value="Sign me up!" name="subscribe" id="mc-embedded-subscribe" class="button">
  </form>
  </div>
  <!--End mc_embed_signup-->
  <p><small>(I post less than once a month. Don&#8217;t worry, I won&#8217;t spam you.)</small></p>
</div>

<h2>Table of Contents</h2>
<ul>
  <li><a href="acknowledgements.html">Acknowledgements</a>
  <li><a href="introduction.html">Introduction</a>
    <ul>
      <li><a href="architecture-performance-and-games.html">Architecture, Performance, and Games</a></li>
    </ul>
  </li>
  <li><a href="design-patterns-revisited.html">Design Patterns Revisited</a>
    <ul>
      <li><a href="command.html">Command</a></li>
      <li><a href="flyweight.html">Flyweight</a></li>
      <li><a href="observer.html">Observer</a></li>
      <li><a href="prototype.html">Prototype</a></li>
      <li><a href="singleton.html">Singleton</a></li>
      <li><a href="state.html">State</a></li>
    </ul>
  </li>
  <li><a href="sequencing-patterns.html">Sequencing Patterns</a>
    <ul>
      <li><a href="double-buffer.html">Double Buffer</a></li>
      <li><a href="game-loop.html">Game Loop</a></li>
      <li><a href="update-method.html">Update Method</a></li>
    </ul>
  </li>
  <li><a href="behavioral-patterns.html">Behavioral Patterns</a>
    <ul>
      <li><a href="bytecode.html">Bytecode</a></em></li>
      <li><a href="subclass-sandbox.html">Subclass Sandbox</a></li>
      <li><a href="type-object.html">Type Object</a></li>
    </ul>
  </li>
  <li><a href="decoupling-patterns.html">Decoupling Patterns</a>
    <ul>
      <li><a href="component.html">Component</a></li>
      <li><a href="event-queue.html">Event Queue</a></li>
      <li><a href="service-locator.html">Service Locator</a></li>
    </ul>
  </li>
  <li><a href="optimization-patterns.html">Optimization Patterns</a>
    <ul>
      <li><a href="data-locality.html">Data Locality</a></li>
      <li><a href="dirty-flag.html">Dirty Flag</a></li>
      <li><a href="object-pool.html">Object Pool</a></li>
      <li><a href="spatial-partition.html">Spatial Partition</a></li>
    </ul>
  </li>
</ul>
</aside>

<h1>Game Programming Patterns</h1>

<div class="rhetorical">
<h2>Hey, Game Developer!</h2>
<ul>
  <li>Do you struggle to make your code hang together into a cohesive whole?</li>
  <li>Find it harder to make changes as your codebase grows?</li>
  <li>Feel like your game is a giant hairball where everything is intertwined with everything else?</li>
  <li>Wonder if and how design patterns apply to games?</li>
  <li>Hear things like &#8220;cache coherency&#8221; and &#8220;object pools&#8221;, but don&#8217;t know how to use them to make your game faster?</li>
</ul>
</div>

<p>I&#8217;m here to help! I wrote this book to answer those questions. It&#8217;s a collection of patterns I found in games to make code cleaner, easier to understand, and faster.</p>

<h2>It&#8217;s Free and Online!</h2>

<p>This is the book I wish I had when I started making games, and I want you to have it now!</p>

<div class="narrow-sign-up sign-up">
  <h2>Want to read it on paper/eBook?</h2>
  <p>I&#8217;m working on those now! Join the mailing list and I&#8217;ll tell you when they&#8217;re ready:</p>

  <!-- Begin MailChimp Signup Form -->
  <div id="mc_embed_signup">
  <form action="http://gameprogrammingpatterns.us7.list-manage.com/subscribe/post?u=0952ca43ed2536d6717766b88&amp;id=0c27329244" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
    <input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
    <input type="submit" value="Sign me up!" name="subscribe" id="mc-embedded-subscribe" class="button">
  </form>
  </div>
  <!--End mc_embed_signup-->
  <p><small>(I post less than once a month. Don&#8217;t worry, I won&#8217;t spam you.)</small></p>
</div>

<a class="start-reading" href="acknowledgements.html">Start Reading!</a>

<div class="narrow-toc">
<h2>Table of Contents</h2>
<table>
<tr>
<td width="50%">
<ul>
  <li><a href="acknowledgements.html">Acknowledgements</a>
  <li><a href="introduction.html">Introduction</a>
    <ul>
      <li><a href="architecture-performance-and-games.html">Architecture, Performance, and Games</a></li>
    </ul>
  </li>
  <li><a href="design-patterns-revisited.html">Design Patterns Revisited</a>
    <ul>
      <li><a href="command.html">Command</a></li>
      <li><a href="flyweight.html">Flyweight</a></li>
      <li><a href="observer.html">Observer</a></li>
      <li><a href="prototype.html">Prototype</a></li>
      <li><a href="singleton.html">Singleton</a></li>
      <li><a href="state.html">State</a></li>
    </ul>
  </li>
  <li><a href="sequencing-patterns.html">Sequencing Patterns</a>
    <ul>
      <li><a href="double-buffer.html">Double Buffer</a></li>
      <li><a href="game-loop.html">Game Loop</a></li>
      <li><a href="update-method.html">Update Method</a></li>
    </ul>
  </li>
</ul>
</td>
<td width="50%">
<ul>
  <li><a href="behavioral-patterns.html">Behavioral Patterns</a>
    <ul>
      <li><a href="bytecode.html">Bytecode</a></em></li>
      <li><a href="subclass-sandbox.html">Subclass Sandbox</a></li>
      <li><a href="type-object.html">Type Object</a></li>
    </ul>
  </li>
  <li><a href="decoupling-patterns.html">Decoupling Patterns</a>
    <ul>
      <li><a href="component.html">Component</a></li>
      <li><a href="event-queue.html">Event Queue</a></li>
      <li><a href="service-locator.html">Service Locator</a></li>
    </ul>
  </li>
  <li><a href="optimization-patterns.html">Optimization Patterns</a>
    <ul>
      <li><a href="data-locality.html">Data Locality</a></li>
      <li><a href="dirty-flag.html">Dirty Flag</a></li>
      <li><a href="object-pool.html">Object Pool</a></li>
      <li><a href="spatial-partition.html">Spatial Partition</a></li>
    </ul>
  </li>
</ul>
</td>
</tr>
</table>
</div>

<h2>Who Am I?</h2>

<img src="images/dogshot.jpg" class="profile" />

<p>I&#8217;m Bob Nystrom. I started writing this book while working at Electronic Arts. In my eight years there, I saw a lot of beautiful code, and a lot of really horrendous code. My hope was that I could take what I learned from the beautiful stuff, write it down here, and then teach it to the people writing the awful stuff.</p>

<p>If you want to get in touch with me, you can email <code>bob</code> at this site or just ask me (<a href="https://twitter.com/intent/user?screen_name=munificentbob"><code>@munificentbob</code></a>) on twitter.

<h2>Have Feedback?</h2>

<p>Part of the magic of writing a book online is that it&#8217;s easy to change. If you find mistakes or have suggestions, please don&#8217;t hesitate to <a href="https://github.com/munificent/game-programming-patterns/issues">file a bug</a> or send me a pull request.</p>

</div>
</div>
<footer>&copy; 2009-2014 Robert Nystrom</footer>
</body>
<script src="jquery-1.10.1.min.js"></script>
<script src="script.js"></script>
</html>